aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/projets/[slug].tsx
Commit message (Collapse)AuthorAgeFilesLines
* refactor(pages): merge Github/Gitlab overview on project pagesArmand Philippot2023-12-181-135/+104
| | | | | | By using conditional fetchning we can avoid to duplicate the ProjectOverview component and be more accurate about what data is loading.
* fix(pages): use dynamic imports for the table of contentsArmand Philippot2023-12-181-2/+8
| | | | | | | The ToCWidget relies on Javascript to display the headings. If JS is disabled in the browser, the widget is empty. For a better UX, we should use dynamic imports. Now, the ToC is only displayed when JS is enabled.
* refactor(pages): rewrite helpers to output schema in json-ld formatArmand Philippot2023-12-141-33/+17
| | | | | | | | | | | | | * make sure url are absolutes * nest breadcrumb schema in webpage schema * trim HTML tags from content/description * use a regular script instead of next/script (with the latter the schema is not updated on route change) * place the script in document head * add keywords, wordCount and readingTime keys in BlogPosting schema * fix breadcrumbs in search page (without query) * add tests (a `MatchInlineSnapshot` will be better but Prettier 3 is not supported yet)
* refactor(hooks): rewrite useBreadcrumbs hookArmand Philippot2023-12-121-12/+8
| | | | | | | * use next/router to get the slug instead of using props * handle cases where the current page title is not provided * update JSON-LD schema to match the example in documentation * add tests
* refactor(pages): refine Project pagesArmand Philippot2023-12-081-124/+232
| | | | | | | | | | | * refactor ProjectOverview component to let consumers handle the value * extract project overview depending on Github to avoid fetching Github API if the project is not on Github * wrap dynamic import in a useMemo hook to avoid infinite rerender * fix table of contents by adding a useMutationObserver hook to refresh headings tree (without it useHeadingsTree is not retriggered once the dynamic import is done) * add Cypress tests
* refactor(hooks): replace useGithubApi with useGithubRepoMetaArmand Philippot2023-12-071-18/+17
| | | | | | | | * use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW
* refactor(pages): refine Projects pageArmand Philippot2023-12-071-2/+2
| | | | | | | * add a `contexts` meta key to projects * replace `technologies` with `contexts` key in projects list * make getProjectsFilenames async * add Cypress tests
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-2/+2
| | | | | | | | | | | | The Typescript mapped types was useful for autocompletion in fetchers but their are harder to maintain. I think it's better to keep each query close to its fetcher to have a better understanding of the fetched data. So I: * colocate queries with their own fetcher * colocate mutations with their own mutator * remove Typescript mapped types for queries and mutations * move data convertors inside graphql services * rename most of data types and fetchers
* refactor(components,pages): extract MDX components mapping from pagesArmand Philippot2023-11-221-113/+4
| | | | | | | Instead of repeating the overriding on each pages, we should define it in one place and reuse it in pages. By default it is not possible to override native HTML tags with MDX so I added a plugin in next config to allow it.
* refactor(components): replace PageLayout template with PageArmand Philippot2023-11-201-57/+55
| | | | | | | | | * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome`
* refactor(components): extract MetaItem from MetaListArmand Philippot2023-11-201-28/+26
| | | | | | * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers.
* refactor(hooks): remove useSettings hookArmand Philippot2023-11-151-6/+6
| | | | | | | It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks.
* refactor(components): replace Sharing with SharingWidget componentArmand Philippot2023-11-141-2/+8
| | | | | | | * all the widgets should have a coherent name * fix mailto uri * remove useless CSS * add tests
* refactor(components): replace Overview with ProjectOverview componentArmand Philippot2023-11-111-123/+39
| | | | | | * `cover` prop is now expecting a ReactElement (NextImage) * `meta` prop is now limited to a specific set of meta items * add a `name` prop to add an accessible name to the figure element
* refactor(components): rewrite NavList componentArmand Philippot2023-11-111-1/+1
| | | | | | | * extract NavItem from NavList * remove `kind` and `listClassName` props (since the consumer has control over NavList, NavItem and NavLink components these props are obsolete)
* feat(components): add a generic Grid componentArmand Philippot2023-11-111-2/+12
| | | | | * merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
* feat(components): add a Time componentArmand Philippot2023-11-111-17/+5
| | | | | | Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-111-35/+133
| | | | | | It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
* refactor(components): replace ResponsiveImage with Figure componentArmand Philippot2023-11-111-4/+6
| | | | | | | | The styles applied to ResponsiveImage are related to the figure and figcaption elements. Those elements could be use with other contents than images. So I extracted them in a Figure component. The ResponsiveImage component is no longer useful: the consumer should use the Image component from `next` and wrap it in a link if needed.
* refactor(components): rewrite SocialLink componentArmand Philippot2023-11-111-9/+28
| | | | | * replace default label with a label prop * rename name prop to icon prop
* refactor(components): rewrite List componentArmand Philippot2023-11-111-0/+23
| | | | | | | | | * change `items` prop to children * replace `kind` prop with `isHierarchical`, `isOrdered` & `isInline` props * add `hideMarker` prop * add `spacing` prop to control item spacing * move lists styles to Sass placeholders to avoid repeats because of headless WordPress
* refactor(components): rewrite Spinner componentArmand Philippot2023-10-241-1/+7
| | | | | | | * Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
* refactor(components): rewrite Heading componentArmand Philippot2023-10-241-1/+62
| | | | | | | | | * remove `alignment` and `withMargin` props (consumer should handle that) * move styles to Sass placeholders to avoid repeats with headings coming from WordPress * refactor some other components that depend on Heading to avoid ESlint errors
* refactor(routes): replace hardcoded routes with constantsArmand Philippot2023-10-241-66/+68
| | | | | | | | It makes it easier to change a route if needed and it avoid typo mistakes. I also refactored a bit the concerned files to be complient with the new ESlint config. However, I should rewrite the pages to reduce the number of statements.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-27/+29
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* build(deps): bump all dependenciesArmand Philippot2023-09-191-5/+5
| | | | | * MDX type has changed so some components props had to be updated * Since Storybook now supports TS, I renamed the main/preview files
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-27/+30
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* chore: make Links and Images compliant with Next.js 13Armand Philippot2023-01-231-5/+11
|
* fix(projects): load content dynamically and refresh table of contentsArmand Philippot2022-09-211-2/+7
| | | | | | | The previous way of handling content import was causing issue. So I use dynamic import instead. However, the table of contents was not displayed because the wrapper is first empty. I added a mutation observer to refresh the table of contents when the body is updated.
* fix(projects): do not transform pre to Code componentArmand Philippot2022-08-211-1/+0
| | | | | Sometimes it is useful to display some preformatted data that are not code.
* refactor(schema): use helpers function to avoid repeat between pagesArmand Philippot2022-05-231-39/+21
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-231-5/+9
|
* chore: update some stylesArmand Philippot2022-05-211-2/+7
| | | | | | | * Improve wp-blocks-columns, wp-block-quote and some images * Make Sharing widget consistent between pages * Remove margin option from lists * Fix Topic logo alignement
* chore: use persistent layoutArmand Philippot2022-05-171-3/+11
| | | | | It prevents to rerender the common components between pages (header, footer...).
* refactor: use custom hook for breadcrumb items and schemaArmand Philippot2022-05-161-17/+10
|
* chore: add Project single pagesArmand Philippot2022-05-131-0/+249